<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

    <script src="./js/vue.js"></script>
    <script>
        window.onload = function() {

            var vm = new Vue({
                el: "#app",
                data: {
                    counter: 0,

                },

                beforeCreate() {
                    console.log('对象创建之前')
                },
                created() {
                    console.log('对象创建之后')

                },
                beforeMount() {
                    console.log('对象加载之前')

                },
                mounted() {
                    console.log('对象加载之后')

                },
                beforeUpdate() {
                    console.log('数据更新之前')

                },
                updated() {
                    console.log('数据更新之后')
                },
                beforeDestroy() {
                    console.log('销毁')
                },
                destroyed() {
                    console.log('销毁')
                },

            })
        }
    </script>

</head>

<body>

    <div id="app">

        <button @click="counter += 1">{{ counter }}</button>
    </div>

</body>

</html>